/*
 * @Author: PC9527\Jack sophia2152@qq.com
 * @Date: 2023-08-10 10:11:23
 * @LastEditors: PC9527\Jack sophia2152@qq.com
 * @LastEditTime: 2023-08-10 11:02:00
 * @Description:
 */
/*
 * @Author: PC9527\Jack sophia2152@qq.com
 * @Date: 2023-08-10 10:11:23
 * @LastEditors: PC9527\Jack sophia2152@qq.com
 * @LastEditTime: 2023-08-10 10:36:44
 * @Description:
 */
import { BasicColumn, FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: 'ID',
    dataIndex: 'id',
    width: 50,
  },
  {
    title: 'ID/名称',
    width: 100,
    customRender: ({ record }) => {
      return record.admin_id ? '' + record.admin_id + '/  ' + record.username : record.username;
    },
  },
  {
    title: '姓名',
    dataIndex: 'true_name',
    width: 100,
  },
  {
    title: '链接',
    width: 120,
    customRender: ({ record }) => {
      return record.method ? '/' + record.method + '/' + record.path : record.path;
    },
  },
  {
    title: '行为',
    dataIndex: 'page',
    width: 100,
  },
  {
    title: '位置/操作ip',
    width: 100,
    customRender: ({ record }) => {
      return record.ip_data ? '[' + record.ip_data + ']  ' + record.ip : record.ip;
    },
  },
  {
    title: '类型',
    dataIndex: 'type',
    width: 80,
  },
  {
    title: '操作时间',
    dataIndex: 'add_time',
    width: 150,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'data',
    label: '选择时间',
    component: 'RangePicker',
    colProps: { span: 6 },
  },
  {
    field: 'path',
    label: '链接',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'ip',
    label: 'IP',
    component: 'Input',
    colProps: { span: 6 },
  },
];
